﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using ex.Base;


namespace ex
{
    class Level : Scene
    {
        Player mainPlayer;
        Vector2 WindowBounds;
        //Enemy enemy;
        SpriteFont font;

        bool paused;
        public static List<AnimatedObject2D> SceneObjects;

        public Level()
        {
            SceneObjects = new List<AnimatedObject2D>();
        }

        public override void Load(ContentManager Content, Vector2 window)
        {
	        WindowBounds = window;
            Animation[] a = new Animation[1];
            a[0].Frame = new Rectangle(0, 0, 39, 43);
            a[0].FrameSize = new Vector2(39, 43);
            a[0].startPosition = new Vector2(39, 0);
            a[0].TotalFrames = new Vector2(0, 3);
            a[0].currentFrame = Vector2.Zero;
            a[0].FrameRate = 32;

            Animation[] sa = new Animation[1];
            sa[0].Frame = new Rectangle(0, 0, 3,9);
            sa[0].FrameSize = new Vector2(3,9);
            sa[0].startPosition = new Vector2(0, 220);
            sa[0].TotalFrames = new Vector2(2, 0);
            sa[0].currentFrame = Vector2.Zero;
            sa[0].FrameRate = 32;
           
           mainPlayer = new Player(Content.Load<Texture2D>(""),
		        Content.Load<Texture2D>(""), WindowBounds / 2, a, sa);
           //enemy = new Enemy(Content.Load<Texture2D>(""), WindowBounds / 2, a);
            //SceneObjects.Add(enemy);





        //Pause:
        /* public override void Update(GameTime gameTime)
        {
            if (Input.GetKeyDown(Keys.Enter)) paused = !paused;
            if (paused) return;
            mainPlayer.Update(gameTime, WindowBounds);
            enemy.Update(mainPlayer.mainPlayer, gameTime);
            
        }

        public override void Draw(SpriteBatch spriteBatch, GameTime gameTime)
        {
            mainPlayer.Draw(spriteBatch,gameTime);
            enemy.Draw(spriteBatch, gameTime);
            if(paused) spriteBatch.DrawString(font, "GAME PAUSED", WindowBounds / 2, Color.Black);
        }*/ 
        }
    }
}